#set(VFS_SOURCES
#        multiterminal-vfs-dbus-interface.cpp
#        multiterminal-vfs-dbus-interface.h
#        multiterminal-vfs-file-enumerator.cpp
#        multiterminal-vfs-file-enumerator.h
#        multiterminal-vfs-file-monitor.cpp
#        multiterminal-vfs-file-monitor.h
#        multiterminal-vfs-file.cpp
#        multiterminal-vfs-file.h
#        multiterminal-vfs-register.cpp
#        multiterminal-vfs-register.h
#        multiterminal-vfs-utils.cpp
#        peony-vfs-multiterminal.cpp
#        peony-vfs-multiterminal.h
#        )

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(peony-vfs-kylin-multiterminal)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

#aux_source_directory(. SRC_LIST)

execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/translations/generate_translations_pm.sh ${CMAKE_CURRENT_SOURCE_DIR})

set(VFS_SOURCES
        multiterminal-vfs-dbus-interface.cpp
        multiterminal-vfs-dbus-interface.h
        multiterminal-vfs-file-enumerator.cpp
        multiterminal-vfs-file-enumerator.h
        multiterminal-vfs-file-monitor.cpp
        multiterminal-vfs-file-monitor.h
        multiterminal-vfs-file.cpp
        multiterminal-vfs-file.h
        multiterminal-vfs-register.cpp
        multiterminal-vfs-register.h
        peony-vfs-multiterminal.cpp
        peony-vfs-multiterminal.h
        )

add_library(peony-vfs-kylin-multiterminal SHARED ${VFS_SOURCES})
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/lib/plugin)

find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB
        glib-2.0
        gobject-2.0
        gio-2.0
        )

target_include_directories(peony-vfs-kylin-multiterminal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(peony-vfs-kylin-multiterminal PUBLIC /usr/include/peony-qt/)
target_include_directories(peony-vfs-kylin-multiterminal PUBLIC ${GLIB_INCLUDE_DIRS})

target_link_libraries(peony-vfs-kylin-multiterminal PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
target_link_libraries(peony-vfs-kylin-multiterminal PUBLIC peony)
target_link_libraries(peony-vfs-kylin-multiterminal PUBLIC ${GLIB_LIBRARIES})
target_link_libraries(peony-vfs-kylin-multiterminal PUBLIC mobile_common)
